package mr.zhang.controller;

import mr.zhang.service.MerChantPropertyService;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.AbstractController;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;



public class DeleteMerchantPropertyController extends AbstractController {
	
	private MerChantPropertyService merChantPropertyService;
	
	

	public MerChantPropertyService getMerChantPropertyService() {
		return merChantPropertyService;
	}



	public void setMerChantPropertyService(
			MerChantPropertyService merChantPropertyService) {
		this.merChantPropertyService = merChantPropertyService;
	}



	@Override
	protected ModelAndView handleRequestInternal(HttpServletRequest request,
			HttpServletResponse response) throws Exception {
		// TODO Auto-generated method stub
		
		int id =Integer.parseInt(request.getParameter("id"));
		
		System.out.println(id);
		
		this.merChantPropertyService.deleteMerchantProperty(id);
		
		
		return new ModelAndView("redirect:/queryMerchantproperty.do");
	}

}
